package cn.exrick.xboot.modules.your.graphics;

import cn.exrick.xboot.XbootApplication;
import cn.exrick.xboot.modules.graphics.entity.Container;
import cn.exrick.xboot.modules.graphics.param.ContainerParam;
import cn.exrick.xboot.modules.graphics.service.IContainerService;
import cn.exrick.xboot.pojo.MethodRequest;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

import static org.junit.Assert.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: njp
 * @Date: 2020/09/10/11:05
 * @Description:
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = XbootApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class IContainerServiceImplTest {

    @Autowired
    private IContainerService iContainerService;
    @Test
    public void page() {
        ContainerParam containerParam = new ContainerParam();

        IPage<Container> page = iContainerService.page(containerParam, new Page());
        System.out.println("20200910测试："+page.getRecords().toString());
    }

    @Test
    public void getList() {
        ContainerParam containerParam = new ContainerParam();
        List<Container> list = iContainerService.getList(containerParam);
        System.out.println(list.toString());
    }

    @Test
    public void add() {
        ContainerParam containerParam = new ContainerParam();
        containerParam.setContent("地址测试");
        containerParam.setTitle("容器标题");
        MethodRequest add = iContainerService.add(containerParam);
        System.out.println(add.toString());
    }
}